package com.cheng.example.atguigu.design_pattern.proxy.staticproxy;

/*
 * @author 程帅
 * @createTime: 2020/10/15 13:05
 * @Created: with IntelliJ IDEA.
 */
// 静态代理对象，静态代理
public class TeacherDaoProxy implements ITeacherDao {

    private ITeacherDao target; //目标对象，通过接口来聚合

    public TeacherDaoProxy(ITeacherDao target) {
        this.target = target;
    }

    @Override
    public void teach() {
        System.out.println("开始代理 完成某些操作");
        target.teach();
        System.out.println("提交");
    }

}
